package com.jiawa.train.business.controller.web;

import com.jiawa.train.business.service.TrainService;
import com.jiawa.train.common.resp.Result;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/web/train")
public class TrainController {

    @Resource
    private TrainService trainService;

    @GetMapping("/query-all")
    public Result queryAll(){
        List trainList = trainService.queryAll();
        return Result.success(trainList);
    }
}
